<?php
//连接数据库
function xss($strxxs){  
    $str = trim($strxxs);  //清理空格  
    $str = strip_tags($str);   //过滤html标签  
    $str = htmlspecialchars($str);   //将字符内容转化为html实体  
    $str = addslashes($str);  //防止SQL注入
    return $str; }
$jd=xss($_GET['jd']);
$wd=xss($_GET['wd']);
$ip=xss($_SERVER["REMOTE_ADDR"]);
$dz="test";

$time=date("YmdHis");
include('./config.php');
$conn=new mysqli($dbconfig['host'],$dbconfig['user'],$dbconfig['pwd'],$dbconfig['dbname']);
if($conn->connect_error){
die($conn->connect_error);
}
$sql="INSERT INTO weizhi (ip,jd,wd,dz,reg_date) VALUES ('$ip','$jd', '$wd','$dz','$time')";
if($conn->query($sql)===TRUE){
echo 'ok';
}
else{
echo $conn->error;
};

mysqli_close($conn);
?>
